package Self_Practice.PROJECT4;

public class Solution {
    public String method(String str){
        StringBuilder sb = new StringBuilder();
        sb.append(str.charAt(0));
        for(int i = 1; i< str.length(); i++){
            if(str.charAt(i) != sb.charAt(sb.length()-1)){
                sb.append(str.charAt(i));
            }else{
                continue;
            }
        }
        String result =sb.toString();
        return result;
    }
}
